package com.action;

import com.opensymphony.xwork2.ActionSupport;

/**
 * Created with IntelliJ IDEA.
 * User: AD
 * Date: 13-7-15
 * Time: 上午9:15
 * To change this template use File | Settings | File Templates.
 */
public class UserAction extends ActionSupport{
	private String userName;
	private String passWord;
    public UserAction() {
        System.out.println("create userAction!");
    }
    public String login() {
    	System.out.println("username="+userName);
        System.out.println("I do this method");
    	if(userName.equals("a") && passWord.equals("a")) { 
    		return "administrator";
    	} else if(userName.equals("b") && passWord.equals("b")) { 
    		return "provider";
    	} else if(userName.equals("c") && passWord.equals("c")){
    		return "customer";
    	} else {
    		return SUCCESS;
    	}
    }
    
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassWord() {
		return passWord;
	}
	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}
    
}
